<%@ Control Language="c#" AutoEventWireup="false" Codebehind="DefaultPermissionListControl.ascx.cs" Inherits="CommunityServer.ControlPanel.PhotoAdmin.DefaultPermissionListControl" TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
<%@ Register TagPrefix="CS" Namespace="CommunityServer.Controls" Assembly="CommunityServer.Controls" %>
<%@ Register TagPrefix="CA" Namespace="ComponentArt.Web.UI" Assembly="ComponentArt.Web.UI" %>
<script type="text/javascript">
  
  
  function onCallbackError(excString)
  {
    if (confirm('<%= CommunityServer.ControlPanel.Components.ResourceManager.GetString("CP_CallBackWarning") %>')) alert(excString); 
    <%= Grid1.ClientID %>.Page(1); 
  }

  function onReset(item)
  {
     return confirm('<%= string.Format(CommunityServer.ControlPanel.Components.ResourceManager.GetString("CP_PhotosAdmin_DefaultPermissionsList_ResetPermission_Warning"), "'+ item.GetMember('Name').Value +'") %>'); 
  }
  
  function resetRow(rowId)
  {
    <%= Grid1.ClientID %>.Delete(<%= Grid1.ClientID %>.GetRowFromClientId(rowId)); 
  }

</script>
<div id="GrayGrid">
	<CA:Grid id="Grid1" runat="server">
		<Levels>
			<CA:GridLevel DataKeyField="RoleIDString">
				<Columns>
					<CA:GridColumn AllowEditing="False" DataField="Name" HeadingText="ResourceManager.CP_Photos_GridCol_Name" />
					<CA:GridColumn columntype="CheckBox" DataField="View" HeadingText="ResourceManager.CP_Photos_GridCol_View"
						Align="Center" AllowEditing="True" />
					<CA:GridColumn columntype="CheckBox" DataField="Reply" HeadingText="ResourceManager.CP_Photos_GridCol_Reply"
						Align="Center" AllowEditing="True" />
					<CA:GridColumn columntype="CheckBox" DataField="Post" HeadingText="ResourceManager.CP_Photos_GridCol_Post"
						Align="Center" DataCellCssClass="LastDataCell" AllowEditing="True" />
					<CA:gridcolumn columntype="CheckBox" datafield="RemoteAttachment" headingtext="ResourceManager.CP_Photos_GridCol_RemoteAttachment"
						align="Center" DataCellCssClass="LastDataCell" visible="False" AllowEditing="True" />
					<CA:GridColumn DataField="RoleIDString" Visible="False" />
					<CA:GridColumn HeadingText="ResourceManager.CP_Photos_GridCol_Actions" DataCellClientTemplateId="EditTemplate"
						EditControlType="EditCommand" Width="80" Align="Center" Visible="False" />
				</Columns>
			</CA:GridLevel>
		</Levels>
		<ClientTemplates>
			<CA:ClientTemplate Id="EditTemplate">
				<a href="javascript:resetRow('## DataItem.ClientId ##');">Reset</a>
			</CA:ClientTemplate>
		</ClientTemplates>
	</CA:Grid>
</div>
